Fix MISRA Rule 5.3 Part 3
authorDaniel Boulby <[email protected]>
Wed, 9 May 2018 09:28:12 +0000 (10:28 +0100)
committerDaniel Boulby <[email protected]>
Tue, 12 Jun 2018 12:21:36 +0000 (13:21 +0100)
Use a _ prefix for macro arguments to prevent that argument from
hiding variables of the same name in the outer scope

Rule 5.3: An identifier declared in an inner scope shall not
          hide an identifier declared in an outer scope

Fixed For:
    make PLAT=fvp SPD=tspd

Change-Id: I2d711b9584c4cb9ba3814ecd2ca65a42b7e24179
Signed-off-by: Daniel Boulby <[email protected]>
services/spd/tspd/tspd_private.h

index 692a967e3f23a25b47d1bb1c471a13ceef0165ae..080e757f49a20e7da9bcec9cb447aa9164945f5c 100644 (file)
@@ -190,14 +190,14 @@ typedef struct tsp_context {
 } tsp_context_t;
 
 /* Helper macros to store and retrieve tsp args from tsp_context */
-#define store_tsp_args(tsp_ctx, x1, x2)                do {\
-                               tsp_ctx->saved_tsp_args[0] = x1;\
-                               tsp_ctx->saved_tsp_args[1] = x2;\
+#define store_tsp_args(_tsp_ctx, _x1, _x2)             do {\
+                               _tsp_ctx->saved_tsp_args[0] = _x1;\
+                               _tsp_ctx->saved_tsp_args[1] = _x2;\
                        } while (0)
 
-#define get_tsp_args(tsp_ctx, x1, x2)  do {\
-                               x1 = tsp_ctx->saved_tsp_args[0];\
-                               x2 = tsp_ctx->saved_tsp_args[1];\
+#define get_tsp_args(_tsp_ctx, _x1, _x2)       do {\
+                               _x1 = _tsp_ctx->saved_tsp_args[0];\
+                               _x2 = _tsp_ctx->saved_tsp_args[1];\
                        } while (0)
 
 /* TSPD power management handlers */